package xjtu.se.articlecommunity.buser.login.impl;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import xjtu.se.articlecommunity.buser.login.dao.BLoginDao;
import xjtu.se.articlecommunity.buser.login.dto.BLoginDto;
import xjtu.se.articlecommunity.common.CommonService;


import javax.annotation.Resource;

@Service
@Transactional
public class BLoginService {
    @Resource
    private BLoginDao loginDao;
    @Resource
    private CommonService commonService;

    public boolean checkLogin(BLoginDto dto){
        int cnt = loginDao.findCountByID(dto);
        return cnt>0;
    }

    public boolean checkMail(String mail) {
        return loginDao.checkMail(mail) > 0;
    }

    public boolean checkTel(String tel) {
        return loginDao.checkTel(tel)>0;
    }

    public String getPwd(String key,String value){
        return loginDao.getPw(key,value);
    }

    public void ApplyFor(BLoginDto dto){ loginDao.applyforBuser(dto);}


}
